from base.base_action import Base


class Authorize_object(Base):
    #同意隐私
    def privacy_agree_button(self):
        return '//android.widget.TextView[@resource-id="com.dangdang.buy2:id/tv_sure"]'
    #同意授权
    def authrize_agree_button(self):
        return '//android.widget.TextView[@resource-id="com.dangdang.buy2:id/tv_sure"]'
    #新人专享
    def ad_close_button(self):
        return '//android.widget.TextView[@resource-id="com.dangdang.buy2:id/dialog_cancel_tv"]'

class Home_object(Base):
    #放大镜
    def home_search_bar_button(self):
        return '//android.widget.TextView[@text=""]'
    def home_search_bar_textview(self):
        return '//android.widget.EditText[@resource-id="com.dangdang.buy2:id/et_search"]'

if __name__ == '__main__':
    #1、将元素封装到类中，导入类就可以直接获取元素
    # from base.authorize_object import Authorize_Object
    print(Authorize_object().privacy_agree_button())
    print(Authorize_object().authrize_agree_button())
    print(Authorize_object().ad_close_button())
#2、其它类继承Authorize_0bject，就可以继承页面上所有的元素
class abc(Authorize_object):
        pass
print(abc().authrize_agree_button())